package com.app.qtjk.lsh.ctrl;
import java.util.ArrayList;
import java.util.HashMap;

import com.app.common.utils.FilterUtil;
import com.app.common.utils.StringUtil;
import com.css.sword.kernel.utils.SwordLogUtils;
import com.css.sword.kernel.utils.SwordServiceUtils;
import com.css.sword.platform.web.controller.BaseDomainCtrl;
import com.css.sword.platform.web.controller.annotations.CTRL;
import com.css.sword.platform.web.event.IReqData;
import com.css.sword.platform.web.event.IResData;
import com.css.sword.platform.web.event.SwordRes;


@CTRL("BrandCtrl")
public class BrandCtrl extends BaseDomainCtrl {

	private static SwordLogUtils log = SwordLogUtils.getLogger(BrandCtrl.class);
	
	/**
	 * 检查用户今天点击该品牌是否加过财富值
	 * @param req
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public IResData addClicknum(IReqData req) throws Exception{

		log.debug("开始进入 BrandCtrl_addClicknum 方法。");

		IResData res = new SwordRes();
		HashMap commonMap = new HashMap();
		ArrayList commonList = new ArrayList();		
		HashMap hashMap = new HashMap();
		try {
			if (FilterUtil.checkToken(req) == false) {
				hashMap.put("returnStatus", "false");
				hashMap.put("msg", "请求口令错误！");
			}else {
				hashMap.put("returnStatus", "true");
				//调用检查用户今天点击品牌是否已增加过财富值
				res = (IResData) SwordServiceUtils.callService("BrandService_todaySfAddWealth", req);
				hashMap.put("todaySfAddWealth", StringUtil.parse2String(res.get("todaySfAddWealth")));
			}
		} catch (Exception e) {
			log.debug("---------------系统发生异常！---------------");
			e.printStackTrace();
			hashMap.put("returnStatus", "false");
			hashMap.put("msg", "出现异常！");
		} finally {
			commonMap.put("commonData", hashMap);
			commonList.add(commonMap);
			res.addListWithDataName("returnData", commonList);
		}
		return res;

	}

}